import java.util.ArrayList;

public class InvertString {

	public static void main(String[] args) {
		String str1 = "ABCDEFG";
		StringBuilder inv = new StringBuilder(str1.length());

		for (int i = str1.length()-1; i >= 0; i--) {
			inv.append(str1.charAt(i));

		}
		System.out.println(inv.toString());

	}

}
